//
//  DDbaseNetWork+Login.h
//  hnGovernment
//
//  Created by 张辉男 on 17/3/7.
//  Copyright © 2017年 安仔. All rights reserved.
//

#import "DDbaseNetWork.h"

@interface DDbaseNetWork (Login)

/**
 登录接口

 @param loginName 账号
 @param passWord 密码
 @param controller 发起请求的控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)login:(NSString *)loginName
           passWord:(NSString *)passWord
         controller:(NSObject *)controller
            success:(successBlock)success
            failure:(failureBlock)failure;


/**
 发送验证码

 @param mobile 电话号码
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)sendMSMcode:(NSString *)mobile
               controller:(NSObject *)controller
                  success:(successBlock)success
                  failure:(failureBlock)failure;


/**
 验证验证码

 @param smsCode 验证码
 @param mobile 电话
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)checkSMScode:(NSString *)smsCode mobile:(NSString *)mobile
                controller:(NSObject *)controller
                   success:(successBlock)success
                   failure:(failureBlock)failure;

/**
 注册账号

 @param mobile 电话号码
 @param password 密码
 @param smsCode 手机验证码
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)registerUseMobile:(NSString *)mobile
                 password:(NSString *)password
                  smsCode:(NSString *)smsCode
               controller:(NSObject *)controller
                  success:(successBlock)success
                  failure:(failureBlock)failure;


/**
 查询用户的信息

 @param token 用户的token
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)queryAllUseMsgUseToken:(NSString *)token
                          controller:(NSObject *)controller
                             success:(successBlock)success
                             faliure:(failureBlock)failure;

/**
 保持修改用户的数据

 @param token 令牌
 @param displayName 昵称
 @param passport 护照
 @param military 军官照
 @param receiverName 收件人
 @param mobile 电话
 @param province 省
 @param city 市
 @param district 县
 @param street 街道
 @param details 详细地址
 @return 请求的id
 */
- (NSNumber *)saveUserInfoWithToken:(NSString *)token
                        displayName:(NSString *)displayName
                           passport:(NSString *)passport
                           military:(NSString *)military
                       receiverName:(NSString *)receiverName
                             mobile:(NSString *)mobile
                           province:(NSString *)province
                               city:(NSString *)city
                           district:(NSString *)district
                             street:(NSString *)street
                            details:(NSString *)details
                         controller:(NSObject *)controller
                            success:(successBlock)success
                            failure:(failureBlock)failure;

/**
 用户重新绑定手机 （发送验证码）

 @param mobile 手机号码
 @param token 令牌
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)rebindMobileSedMSMcode:(NSString *)mobile
                               token:(NSString *)token
                          controller:(NSObject *)controller
                             success:(successBlock)success
                             failure:(failureBlock)failure;



/**
 保存重新绑定的手机

 @param newMobile 新手机号
 @param oldMobile 旧手机号
 @param token 令牌
 @param smsCode 验证码
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)saveRebindNewMobile:(NSString *)newMobile
                        oldMobile:(NSString *)oldMobile
                            token:(NSString *)token
                          smsCode:(NSString *)smsCode
                       controller:(NSObject *)controller
                          success:(successBlock)success
                            error:(failureBlock)failure;


/**
 发送邮箱验证码

 @param email 邮箱
 @param token 令牌
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)sendMailCode:(NSString *)email
                     token:(NSString *)token
                controller:(NSObject *)controller
                   success:(successBlock)success
                   failure:(failureBlock)failure;


/**
 保存绑定的邮箱

 @param email 邮箱
 @param token 令牌
 @param code 验证码
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)saveEmailInfo:(NSString *)email
                      token:(NSString *)token
                       code:(NSString *)code
                 controller:(NSObject *)controller
                    success:(successBlock)success
                    failure:(failureBlock)failure;


/**
 修改密码

 @param oldPassword 旧密码
 @param newPassWord 新密码
 @param token 令牌
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)userResetPasswordWithOldPassWord:(NSString *)oldPassword
                                   newPassWord:(NSString *)newPassWord
                                         token:(NSString *)token
                                    controller:(NSObject *)controller
                                       success:(successBlock)success
                                       failure:(failureBlock)failure;


/**
 获取图片验证码

 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)findPwdImgcode:(NSObject *)controller
                     Success:(successBlock)success
                     failure:(failureBlock)failure;



/**
 忘记密码 -> 确认账号

 @param account 账号
 @param imageCodeID 验证码的id
 @param code 验证码
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)checkUserAccount:(NSString *)account
                   imageCodeId:(NSString *)imageCodeID
                          code:(NSString *)code
                    controller:(NSObject *)controller
                       success:(successBlock)success
                       failure:(failureBlock)failure;

/**
 忘记密码 -> 发送手机验证码

 @param mobile 手机号码
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)forgerPwdToSendSMScode:(NSString *)mobile
                          controller:(NSObject *)controller
                             success:(successBlock)success
                             failure:(failureBlock)failure;



/**
 忘记密码 -> 重设密码

 @param password 重设的密码
 @param smsCode 验证码
 @param mobile 手机号
 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)forgetPwdRestPassword:(NSString *)password
                    confirmPassword:(NSString *)confirmPassword
                            smsCode:(NSString *)smsCode
                             mobile:(NSString *)mobile
                         controller:(NSObject *)controller
                            success:(successBlock)success
                            failure:(failureBlock)failure;


/**
 用户退出登录

 @param controller 控制器
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)userLoginOutWithToken:(NSString *)token
                         Controller:(NSObject *)controller
                            success:(successBlock)success
                            failure:(failureBlock)failure;



/**
 用户上传图片
 
 @param image 图片
 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)uploadImage:(UIImage *)image
                  success:(DDuploadSuccessBlcok)success
                  faliure:(failureBlock)failure;


/**
 判断版本是否需要升级

 @param success 成功的回调
 @param failure 失败的回调
 @return 请求的id
 */
- (NSNumber *)checkUpdateVersionSuccess:(successBlock)success
                                failure:(failureBlock)failure;

@end
